class TFShieldBelt extends TFPowerups;

state Activated
{
	function BeginState()
	{
		initialstate='activated';
        if(instigator==none) instigator=pawn(owner);
        instigator.AddShieldStrength(100-instigator.ShieldStrength);
        Owner.PlaySound(ActivateSound,SLOT_Interface,3);
        bActive = true;
        settimer(2, true);
	}

    function Timer()
    {
        local float amount;

	    amount=fmax(0,fmin(100-instigator.ShieldStrength,5));
        if(amount>=1)
        {
            instigator.AddShieldStrength(amount);
            owner.PlaySound(sound'TFMedia.TFRepliArmor',SLOT_None,0.75);
        }

        if(instigator==none || instigator.Health<=0) gotostate('');
    }

	function EndState()
	{
        bActive = false;
	}

	function Activate()
	{

	}
}

defaultproperties
{
     bAutoActivate=True
     bActivatable=True
     ActivateSound=Sound'TFMedia.Equipment.TFAmmoRepStart'
     bReplicateInstigator=True
     SkillCost=200
}
